package com.windmill.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ChangeCard implements Serializable{
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private long linkQQ;
	private List<ThemeCard> changeThemes;//换卡设置
	private List<Card> cards;
	private long saveQQ;
	public ChangeCard(){
		this.changeThemes = new ArrayList<ThemeCard>();
		this.cards = new ArrayList<Card>();
	}
	public List<ThemeCard> getChangeThemes() {
		return changeThemes;
	}
	public void setChangeThemes(List<ThemeCard> changeThemes) {
		this.changeThemes = changeThemes;
	}
	public long getLinkQQ() {
		return linkQQ;
	}
	public void setLinkQQ(long linkQQ) {
		this.linkQQ = linkQQ;
	}
	public long getSaveQQ() {
		return saveQQ;
	}
	public void setSaveQQ(long saveQQ) {
		this.saveQQ = saveQQ;
	}
	public String getCardsName(){
		StringBuffer sb = new StringBuffer();
		for(Card card:cards){
			if(!sb.toString().contains(card.getName())){
				sb.append(card.getName()+";");
			}
		}
		return sb.toString();
	}
	public List<Card> getCards() {
		return cards;
	}
	public void setCards(List<Card> cards) {
		this.cards = cards;
	}
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof ChangeCard){
			if(((ChangeCard)obj).getLinkQQ()==this.linkQQ){
				return true;
			}
		}
		return false;
	}
	public String getLockNames() {
		StringBuffer sb = new StringBuffer();
		for(ThemeCard theme:changeThemes){
			sb.append(theme.getName()+";");
		}
		if(changeThemes.size()==0)
			sb.append("无,");
		return sb.toString();
	}	
}
